﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;

namespace community_severvice_exchange
{
    public class Loader
    {
        List<Skills> list_skill = new List<Skills> ();
        List<User> list_users = new List<User> ();
        Skills skills = null;

        public List<Skills> LoaderSkill()
        {
           using(FileStream f = new FileStream("skills.txt",FileMode.Open,FileAccess.Read))
            {
                using(StreamReader sr = new StreamReader(f))
                {
                    string line = null;
                    string[] temp = null;
                    while ((line = sr.ReadLine()) != null) 
                    {
                        temp=line.Split('+');
                        skills = new Skills();
                        skills.ID = temp[0];
                        skills.Hour = temp[1];
                        skills.Item = temp[2];
                        skills.Desc = temp[3];
                        list_skill.Add(skills);
                    }
                }
            }
           return list_skill;
        }
    }
}
